<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/FoodSageTemplate.xhtml">

    <ui:define name="logout">
        <p:commandLink id="logoutLink" actionListener="#{touristLogoutManagedBean.doLogout}" value="#{bundle['login.logout.label']}" ajax="false" immediate="true" />
    </ui:define>

    <ui:define name="main_menu">
        <f:view beforePhase="#{itineraryChooseItineraryTypeManagedBean.initView}"/>
        <p:menubar model="#{itineraryChooseItineraryTypeManagedBean.touristMainMenuModel}"/>
    </ui:define>

    <ui:define name="nav_menu">
        <p:menu model="#{itineraryChooseItineraryTypeManagedBean.touristNavMenuModel}"/>
    </ui:define>

    <ui:define name="content">
        <h:form id="formMain">
            <h1>Your payment is successful</h1>
            <br/>
            <br/>
            <p:fieldset style="width:950px">
                <h2>Here are your payment details : </h2>
                <h:panelGrid columns="2" columnClasses="column" cellpadding="5">
                    <h:panelGrid columns="2" border="1" columnClasses="column" cellpadding="5">

                        <h:outputText value="Paypal Transaction ID" style="font-weight:bold; text-align:center; font-size:12px" />
                        <h:outputText value="#{purchaseGrouponManagerBean.transactionId}" />

                        <h:outputText value="Paypal Correlation ID" style="font-weight:bold; text-align:center; font-size:12px"/>
                        <h:outputText value="#{purchaseGrouponManagerBean.correlationId}" />

                        <h:outputText value="Total Amount Paid" style="font-weight:bold; text-align:center; font-size:12px"/>
                        <h:outputText value="#{purchaseGrouponManagerBean.totalAmount} SGD"/>

                        <h:outputText value="Date Paid" style="font-weight:bold; text-align:center; font-size:12px"/>
                        <h:outputText value="#{purchaseGrouponManagerBean.paymentDate}" />

                        <h:outputText value="Groupon name" style="font-weight:bold; text-align:center; font-size:12px"/>
                        <h:outputText value="#{purchaseGrouponManagerBean.selectedGroupon.groupon.name}"/>

                        <h:outputText value="Offered Price" style="font-weight:bold; text-align:center; font-size:12px"/>
                        <h:outputText value="#{purchaseGrouponManagerBean.selectedGroupon.groupon.offeredPrice}"/>

                        <h:outputText value="Quantity" style="font-weight:bold; text-align:center; font-size:12px"/>
                        <h:outputText value="#{purchaseGrouponManagerBean.purchase.quantity}"/>

                        <h:outputText value="Expiry Date" style="font-weight:bold; text-align:center; font-size:12px"/>
                        <h:outputText value="#{purchaseGrouponManagerBean.selectedGroupon.groupon.endValidDate}">
                            <f:convertDateTime dateStyle="full" pattern="EEE, dd/MM/yyyy" timeZone="EST" type="date" />
                        </h:outputText>
                    </h:panelGrid>

                    <p:graphicImage id="imageDisplay" value="/images/upload/media/#{purchaseGrouponManagerBean.selectedGroupon.groupon.imageURL}"
                                    height="300" width="450"/> 
                </h:panelGrid>

            </p:fieldset>
            <br/>
            <h3>A confirmation email has been sent to your email address. You may keep it as a reference for this purchase.</h3>
            <br/>
            <h3> Thank you and have a good day !</h3>
        </h:form>
    </ui:define>

</ui:composition>